package cn.xiangyuanpin.tests;

import cn.xiangyuanpin.dao.OrderDao;
import cn.xiangyuanpin.dao.OrderItemDao;
import cn.xiangyuanpin.dao.impl.OrderDaoImpl;
import cn.xiangyuanpin.dao.impl.OrderItemDaoImpl;
import cn.xiangyuanpin.pojo.Order;
import cn.xiangyuanpin.pojo.OrderItem;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.Date;

import static org.junit.Assert.*;

public class OrderDaoImplTest {

    private OrderItemDao orderItemDao=new OrderItemDaoImpl();
    private OrderDao orderDao=new OrderDaoImpl();

    @Test
    public void saveOrder() {
        Order order=new Order("1234567",new Date(),new BigDecimal(10),0,1);
orderDao.saveOrder(order);
    }
    @Test
    public void saveOrderItem() {
     OrderItem orderItem1=new OrderItem
             (null,"java",1,new BigDecimal(10),new BigDecimal(10),"123456");
        OrderItem orderItem2=new OrderItem
                (null,"C++",1,new BigDecimal(10),new BigDecimal(10),"123456");
        OrderItem orderItem3=new OrderItem
                (null,"python",2,new BigDecimal(10),new BigDecimal(20),"123456");
    orderItemDao.saveOrderItem(orderItem1);
        orderItemDao.saveOrderItem(orderItem2);
        orderItemDao.saveOrderItem(orderItem3);
    }


}